/* DISCLAIMER
Original file written by Johnny on Flame.
This piece is protected by the GPLv3 License. Commercial uses of this should only happen with my consent.
JohnnyonFlame (a_t) Hotmail (d_o_t) com
----------------------------------------------------------
This class deals with ITEM and LIST allocations.
The objective of this class is giving an easier and faster
way of allocating these darn lists into ram.
----------------------------------------------------------*/

#include <stdlib.h>
#include "items.h"
#include "callbacks.h"

void *ITEM_Alloc(char *label, void *callback)
{
	//TODO
	List_Item *item = malloc(sizeof(List_Item));

	item->label = label;
	item->funcCallback = callback;

	return item;
}

void *List_Alloc(unsigned int count)
{
	//TODO
	List_Items *list = malloc(sizeof(List_Items));

	list->items = malloc(sizeof(List_Item)*count);
	list->count = count;

	int i=-1;
	while (i<(int)count-1){
		i++;
		list->items[i].funcCallback=NULL;
		list->items[i].drawCallback=DRAW_Item;
		list->items[i].overlay_file=NULL;
		list->items[i].label=NULL;
		list->items[i].type=NULL;
		list->items[i].arga=NULL;
		list->items[i].argb=NULL;
	}

	return list;
}	

